dofile "lib/radical.lua"

function png(s) 
  return const.path.gfx.."game/test/"..s..".png"; 
end

function jpg(s) 
  return const.path.gfx.."game/"..s..".jpg"; 
end

function jpg2(s) 
  return const.path.gfx.."game/1-deadhour/wake/"..s..".jpg"; 
end

function dxml(s)
  return const.path.dlg.."1-deadhour/wake/"..s..".xml";
end

main = engine.main {
   start        = chain_ {
                     --episode_("1-wake")
                     musplayer_("testplayer")
                    ,walk_("testroom")
                  }
  ,finish       = gamefile_("1-deadhour/med.lua")
}

testplayer = musplayer.player {
   sfx("footsteps"):inside("slide2"):always()
}

wake = engine.state {}

slide1 = slidedown {
   tile         = png "bed"
  ,next         = "testroom"
}

anim1 = anim {
   frames       = {
                     png "lamp1"
                    ,png "lamp2"
                    ,png "lamp3"
                    ,png "lamp4"
                    ,png "lamp5"
                    ,png "lamp6"
                    ,png "lamp7"
                    ,png "lamp6"
                    ,png "lamp5"
                    ,png "lamp4"
                    ,png "lamp3"
                    ,png "lamp2"
                    ,png "lamp1"
                    
                    ,png "lamp2"
                    ,png "lamp3"
                    ,png "lamp4"
                    ,png "lamp5"
                    ,png "lamp6"
                    ,png "lamp7"
                    ,png "lamp6"
                    ,png "lamp5"
                    ,png "lamp4"
                    ,png "lamp3"
                    ,png "lamp2"
                    ,png "lamp1"
                  } 
  ,next         = "testroom"
}

slide2 = slidedown {
   fps          = 1
  ,x            = 70
  ,y            = 360
  ,step         = 40
  ,tile         = png "oldstairs_up"
  ,next         = "black"
}

black = pause {
   time         = 1000
  ,next         = "block1"
}

block1 = scene {
   tile         = png "apblock1"
}

drug = item {
  nam = "Таблетка мепередина", ico = ico "tab", img = ico "tab-use"
}

cup = item {
  nam = "Кружка", ico = ico "cup", img = ico "cup-use",
  use = chooseuse_ {
          ["bed"] = "You cannot do this!"
        }
}
testroom = scene {
   tile         = png "bed"
  ,dsc          = [[Вики {dad|проекта} находится в стадии активной разработки. Нужна переработка старой документации и 
                    создание новой, поддержание актуальной информации о вышедших квестах, нужны переводы уже существующих 
                    страниц на английский язык и много чего другого! Если вам не безразличен INSTEAD и вы хотите помочь, 
                    то редактирование вики будет очень кстати! ARR]]
  ,obj          = { "bed" }
  ,nav          = { down = vw("Выйти из тестовой комнаты", "testroom2") }
}

dad = staticitem {
  act           = walk_("dad_dlg")
}

bed = staticitem {
   dsc          = "There is a {bed} in this room."
  ,act          = "This is a regular bed, nothing interesting."
}

testroom2 = scene {
   tile         = png "armchair"
  ,bounds       = { 210, 135, 600 }
  ,dsc          = "{obj|some description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and description 2 and}^Regular ext"
  ,nav          = { up = vw("testroom", "testroom") }
}

dad_dlg = dialog {
   tile         = png "bed"
  ,dlg          = dxml "dad"
}